<template>
	<div class="start-page-component">
		
		 <img src="/static/images/login/start-app.png" class="start-img" width="100%" height="auto">
		<!-- <view class="logo">
			 <img src="/static/images/login/start-app.png" class="start-img">
		</view> -->
		<!-- <image src="/static/images/login/app_name.png" class="logo_name"></image> -->
	</div>
</template>

<script setup lang="ts">
import { onShow, onLoad } from "@dcloudio/uni-app"
import { global } from "@/utils/index.ts"

onShow(() =>{
	setTimeout(() => {
		if(global.getToken()){
			uni.switchTab({
				url:"/pages/tabbar/home/index",
				animationType: 'pop-in',
				animationDuration: 200
			})
		} else {
			uni.switchTab({
				url:"/pages/tabbar/home/index",
				animationType: 'pop-in',
				animationDuration: 200
			})
			// 因为现在没有登录也可以进行预览，因此先不跳转到登录页， 当有操作的时候才有跳转到登录页
			// uni.reLaunch({
			// 	url:"/pages/login/index",
			// 	animationType: 'pop-in',
			// 	animationDuration: 200
			// })
		}
	}, 1000)
})
	
</script>

<style scoped lang="scss">
	.start-page-component{
		position: relative;
		width: 100vw;
		height: 100vh;
		display: flex;
		align-items: center;
		flex-direction: column;
		// justify-content: center;
		background-color: #fff; /* 或者其他你希望的背景颜色 */
		.start-img{
			    position: absolute;
			    top: 0;
			    right: 0;
			    bottom: 0;
			    left: 0;
			    margin: auto;
			    width: 100%;
			    height: auto;
			// height: auto;
			// object-fit: cover; /* 保持原始宽高比，填充容器 */
		}
		.logo{
			position: relative;
			width: 100vw;
			height: 100vh;
			// background: url('/static/images/login/texture.png') center center no-repeat;
			.start-img{
				    position: absolute;
				    top: 0;
				    right: 0;
				    bottom: 0;
				    left: 0;
				    margin: auto;
				    width: 100%;
				    height: auto;
				// height: auto;
				// object-fit: cover; /* 保持原始宽高比，填充容器 */
			}
		}
		.logo_name{
			width: 229px;
			height: 61px;
			position: absolute;
			bottom: 350upx;
		}
		
	}
</style>